package lhb.test.SC.common.web;

import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import lhb.test.SC.common.filter.LogFilter;

@Configuration
public class WebConfigurer {

	@Bean
	public FilterRegistrationBean greetingFilterRegistrationBean() {
		FilterRegistrationBean registrationBean = new FilterRegistrationBean();
		registrationBean.setName("logFilter");
		LogFilter logFilter = new LogFilter();
		registrationBean.setFilter(logFilter);
		registrationBean.setOrder(1);
		List<String> urlList = new ArrayList<String>();
		urlList.add("/*");
		registrationBean.setUrlPatterns(urlList);
		return registrationBean;
	}
}
